//
//  LSZNotifyClassificationVC.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/9/10.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZNotifyClassificationVC.h"

@interface LSZNotifyClassificationVC ()<LCDisplayViewControllerDelegate>

@property (strong, nonatomic) UIView *viewFenGe;
@end

@implementation LSZNotifyClassificationVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"通知";
    self.delegate = self;
    [self setupAllViewController];
    [self setupAllVCData];
    self.view.backgroundColor = [UIColor whiteColor];
    UIView * viewFenGe = [[UIView alloc]initWithFrame:CGRectMake(0, 43+NAVIGATION_BAR_HEIGHT, ScreenWidth, 1)];
    _viewFenGe = viewFenGe;
    viewFenGe.backgroundColor = divider;
    [self.view addSubview:viewFenGe];
    [viewFenGe sendSubviewToBack:self.view];
    /**增加侧滑返回,无其他作用*/
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, ScreenHeight)];
    [self.view addSubview:view];
    [self.view bringSubviewToFront:view];
}
- (void)setupAllViewController {
    // 标题渐变
    // *推荐方式(设置标题渐变)
    [self setUpTitleGradient:^(LCTitleColorGradientStyle *titleColorGradientStyle, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor) {
        *norColor = RGBColor(140, 140, 140);
        // 设置标题选中颜色
        *selColor = RGBColor(238, 82, 74);
    }];
    // 设置标题字体
    // 推荐方式
    [self setUpTitleEffect:^(UIColor *__autoreleasing *titleScrollViewColor, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor, UIFont *__autoreleasing *titleFont, CGFloat *titleHeight, CGFloat *titleWidth) {
        // 设置标题字体
        CGFloat size = [LSZSpecialPackaging initWithReturnsthesizeOf:15 :0.5];
        *titleFont = FONT_(size);
    }];
}
- (void)setupAllVCData {
    // 移除之前所有子控制器
    [self.childViewControllers makeObjectsPerformSelector:@selector(removeFromParentViewController)];
    NSArray *titleDatas = [[NSArray alloc]init];
    titleDatas = @[@"通知",@"私信"];
    for (NSInteger i = 0; i < titleDatas.count; i++) {
        if (i == 0) {
            LSZNoticeNameViewController * vc = [[LSZNoticeNameViewController alloc]init];
            vc.title = titleDatas[i];
            [self addChildViewController:vc];
        }
        else if ([titleDatas[i] isEqualToString:@"私信"]) {
            LSZDirectMessagesVC * vc = [[LSZDirectMessagesVC alloc]init];
            vc.title = titleDatas[i];
            [self addChildViewController:vc];
        }
        else{
        }
    }
    // 注意：必须先确定子控制器
    [self refreshDisplay];
}
-(void)tabBarContentViewDidSelectItemAtIndex:(NSInteger)index{
    NSLog(@"tabBarContentViewDidSelectItemAtIndex = %zd", index);
}
//标签头部底部分割线
- (void)viewDidLayoutSubviews {
    [super viewDidLayoutSubviews];
    [_viewFenGe sendSubviewToBack:self.view];
}


@end
